package com.chenjie.controller.drools; 

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.chenjie.drools.entity.DroolsParam;
import com.chenjie.drools.service.FactService;
import com.huawei.common.entity.Result;

@RestController
@RequestMapping("center")
@CrossOrigin
public class DroolsController {
	@Autowired
	private FactService factService;

	@RequestMapping(value = "hello", method = RequestMethod.POST)
	public Result<String> drools() {
		return Result.ok("this is drools!");
	}

	@RequestMapping(value = "createBean", method = RequestMethod.POST)
	public Result<Object> createBean(DroolsParam droolsParam) {
		factService.createBean(droolsParam);
		return Result.ok();
	} 
}
